import {validatorPhone,validatorEmail } from "@/utils/validate"
const rules =  {
    username: [
      { required: true, message: '请输入名称', trigger: 'change' },
      { min: 2, max: 6, message: '长度在 3 到 5 个字符', trigger: 'change' }
    ],
    password: [
      { required: true, message: '请输入密码', trigger: 'change' },
      { min: 5, max: 10, message: '长度在 5 到 10 个字符', trigger: 'change' }
    ],
    sex: [
      { required: true, type: 'number', message: '请选择性别', trigger: 'change' },
    ],
    phoneNum:[
      { required: true,validator: validatorPhone, trigger: 'change' }
    ],
    email:[
      { required: true,validator: validatorEmail, trigger: 'change' }
    ],
    birth: [
      { type: 'date', required: true, message: '请选择生日', trigger: 'change' }
    ],
    'role.id':[
      { required: true, message: '请选择类型', trigger: 'change' }
    ],
    isEnable:[
      { required: true, type: 'number', message: '请选择状态', trigger: 'change' },
    ],

    createTime: [
      { type: 'date', required: true, message: '请选择创建时间', trigger: 'change' }
    ],
    
  }
    
  export default rules